package com.gen.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zzx.dao.ILikeDao;
import com.zzx.entity.Like;

@Service
public class LikeServiceImpl implements ILikeService{
	@Autowired
	private ILikeDao likeDao;

	public ILikeDao getLikeDao() {
		return likeDao;
	}

	public void setLikeDao(ILikeDao likeDao) {
		this.likeDao = likeDao;
	}

	@Override
	public int insertLikeToLike(Like like) {
		return likeDao.insertLikeToLike(like);
	}

	@Override
	public int deleteLikeFromLikeByPid(int pid) {
		return likeDao.deleteLikeFromLikeByPid(pid);
	}

	@Override
	public Like selectLikeFromLikeByPid(int pid) {
		return likeDao.selectLikeFromLikeByPid(pid);
	}

	@Override
	public List<Like> selectAllLikesWithGoods() {
		return likeDao.selectAllLikesWithGoods();
	}

	@Override
	public int updateLikeGoodsPlusOne(Integer pid) {
		return likeDao.updateLikeGoodsPlusOne(pid);
	}

	@Override
	public int updateLikeGoodsReduceOne(Integer pid) {
		return likeDao.updateLikeGoodsReduceOne(pid);
	}
	
	@Override
	public Integer selectCountByPid(Integer pid) {
		return likeDao.selectCountByPid(pid);
	}

}
